package com.cuijq.ratelimiter.v1.rule;

import lombok.Data;

/**
 * @author by CuiJQ
 * @Classname ApiLimit
 * @Description ApiLimit Description
 * @Date 2021/5/31 21:14
 */
@Data
public class ApiLimit {

  private static final int DEFAULT_TIME_UNIT = 1; // 1 second
  private String api;
  private int limit;
  private int unit = DEFAULT_TIME_UNIT;

  public ApiLimit() {
  }

  public ApiLimit(String api, int limit) {
    this(api, limit, DEFAULT_TIME_UNIT);
  }

  public ApiLimit(String api, int limit, int unit) {
    this.api = api;
    this.limit = limit;
    this.unit = unit;
  }

}
